using System;
using System.Windows.Forms;
using Preparation;


namespace Tester.GuiActions.Actions.Impl
{
    public class ViewLogAction : ViewTestItemBaseAction
    {
        public override bool Visible
        {
            get
            {
                if (base.Visible)
                {
                    Test test = (Test)TesterList.Instance.SelectedItems[0].Tag;
                    return test.Results.translationLog.items.Count > 0;
                } else
                {
                    return false; 
                }
            }
        }

        public override void MainAction(object sender, EventArgs e)
        {
            if (Visible)
            {
                Test test = (Test)TesterList.Instance.SelectedItems[0].Tag; 
                GuiHelper.ShowXslt(test.Results.translationLog, Application.StartupPath + @"\conf\log.xslt");
            }
        }
    }
}
